<div class="drop-body">
	<table class="cart-list">
		<tbody>
			<?php 
			if(empty($this->cart))
			{
				echo "<p>Giỏ hàng chưa có sản phẩm nào</p>";
			}else
			{
			    echo $this->partialLoop('view.helper/drop.menu.phtml',$this->cart);
			}
			?> 
		</tbody>
	</table>
	<table class="cart-end">
		<tbody>
		<?php if(isset($this->total) and $this->total != 0):?>
			<tr>
				<th>Sub-Total:</th>
				<td>$<?php echo $this->total?></td>
			</tr>
			<tr>
				<th>Eco Tax (-2.00):</th>
				<td>$8.00</td>
			</tr>
			<tr>
				<th>Total:</th>
				<td>$<?php echo $this->total + 8;?></td>
			</tr>
		<?php else:?>
		    <tr>
				<th>Sub-Total:</th>
				<td>$0.00</td>
			</tr>
			<tr>
				<th>Eco Tax (-2.00):</th>
				<td>$0.00</td>
			</tr>
			<tr>
				<th>Total:</th>
				<td>$0.00</td>
			</tr>
		<?php endif;?>
		</tbody>    
	</table>
	<div class="cart-buttons">
		<a href="<?php echo $this->baseUrl();?>" class="button button-small button-alt">Thanh Toán</a>
		<a href="<?php echo $this->baseUrl().'/giohang';?>" class="button button-small">Giỏ hàng</a>
	</div>
</div>
<script type ="text/javascript">
$(document).ready(function(){
	$('.remove > div').click(function(){
		$.ajax({
			type : 'POST',
			url : "http://localhost/zend/kidshop/giohang/xoa/"+$(this).attr('id'),
			dataType: "json",
			success : function(data){
				if(data !=null){
					$('#coin').text("$"+data.total);
					$('.cart-count').text(data.num +' item(s)');
				}else{
					$('#coin').text("$ 0");
					$('.cart-count').text('0 item(s)');
				}
				
			},
			complete : function(){
				$.ajax({
					type : 'POST',
					url : "http://localhost/zend/kidshop/cart/drop-menu",
					dataType: "html",
					success : function(data){
						$('.drop-content').html(data);
					},
					error: function(){
						alert("Ajax is failure");
					}
				});
			},error:function(){
			    alert("dsa");
				}
			
		});
	});
});
</script>